package org.nf.trading.controller;

import org.nf.trading.vo.ResultVO;
import org.springframework.http.HttpStatus;

public class BaseController {
    public ResultVO success(){
        ResultVO vo = new ResultVO();
        vo.setCode(HttpStatus.OK.value());
        return vo;
    }
    public ResultVO success(String message){
        ResultVO vo = new ResultVO<>();
        vo.setCode(HttpStatus.OK.value());
        vo.setMessage(message);
        vo.setData(true);
        return vo;
    }
    public ResultVO success(Object data){
        ResultVO vo = new ResultVO();
        vo.setCode(HttpStatus.OK.value());
        vo.setMessage("成功");
        vo.setData(data);
        return vo;
    }
    public ResultVO success(Integer code,String message,Object data){
        ResultVO vo = new ResultVO();
        vo.setCode(code);
        vo.setMessage(message);
        vo.setData(data);
        return vo;
    }
}
